package com.ruoyi.bussiness.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 成交订单对象 ccy_trade_success
 * 
 * @author wzy
 * @date 2025-10-21
 */
@Data
public class CcyTradeSuccess extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 数据库主键 */
    private Long id;

    /** 方案编号 */
    @Excel(name = "方案编号")
    private String planId;

    /** 账号名 */
    @Excel(name = "账号名")
    private String accName;

    /** 账号编号 */
    @Excel(name = "账号编号")
    private String accCode;

    /** 交易对 */
    @Excel(name = "交易对")
    private String instId;

    /** 数据级别 */
    @Excel(name = "数据级别")
    private String bar;

    /** 策略订单id */
    private String algoId;

    /** 委托数量 */
    @Excel(name = "委托数量")
    private int sz;

    /** 订单方向 */
    @Excel(name = "订单方向")
    private String side;

    /** 委托触发价 */
    @Excel(name = "委托触发价")
    private String triggerPx;

    /** 止盈收益率 */
    @Excel(name = "止盈收益率")
    private String zysyl;

    /** 止盈触发价 */
    @Excel(name = "止盈触发价")
    private String tpTriggerPx;

    /** 止损收益率 */
    @Excel(name = "止损收益率")
    private String zssyl;

    /** 止损触发价 */
    @Excel(name = "止损触发价")
    private String slTriggerPx;

    /** 已实现收益 */
    @Excel(name = "已实现收益")
    private String realizedPnl;

    /** 累计手续费 */
    @Excel(name = "累计手续费")
    private String fee;

    /** 下单描述 */
    @Excel(name = "下单描述")
    private String tradeMsg;

    /** 开仓均价 */
    @Excel(name = "开仓均价")
    private String openAvgPx;

    /** 平仓均价 */
    @Excel(name = "平仓均价")
    private String closeAvgPx;

    /** 观察时间 */
    @Excel(name = "观察时间", width = 30, dateFormat = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date gcTime;

    /** 基础价 */
    @Excel(name = "基础价")
    private String gcTimePrice;

    /** 开仓时间 */
    @Excel(name = "开仓时间", width = 30, dateFormat = "yyyy-MM-dd")
    private String openTime;

    /** 平仓时间 */
    @Excel(name = "平仓时间", width = 30, dateFormat = "yyyy-MM-dd")
    private String closeTime;

    /** 平仓收益率 */
    @Excel(name = "平仓收益率")
    private String pnlRatio;

    /** 监控阈值 */
    @Excel(name = "监控阈值")
    private String monitorYz;

    /** 收益更新 0未更新 1已更新收益 */
    @Excel(name = "收益更新 0未更新 1已更新收益")
    private Long updateState;

    /** 账号用户 */
    @Excel(name = "账号用户")
    private String userName;

    /** 数据添加时间 */
    @Excel(name = "数据添加时间", width = 30, dateFormat = "yyyy-MM-dd")
    private String addTime;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("accName", getAccName())
            .append("accCode", getAccCode())
            .append("instId", getInstId())
            .append("bar", getBar())
            .append("algoId", getAlgoId())
            .append("sz", getSz())
            .append("side", getSide())
            .append("triggerPx", getTriggerPx())
            .append("zysyl", getZysyl())
            .append("tpTriggerPx", getTpTriggerPx())
            .append("zssyl", getZssyl())
            .append("slTriggerPx", getSlTriggerPx())
            .append("realizedPnl", getRealizedPnl())
            .append("fee", getFee())
            .append("tradeMsg", getTradeMsg())
            .append("openAvgPx", getOpenAvgPx())
            .append("closeAvgPx", getCloseAvgPx())
            .append("gcTime", getGcTime())
            .append("gcTimePrice", getGcTimePrice())
            .append("openTime", getOpenTime())
            .append("closeTime", getCloseTime())
            .append("pnlRatio", getPnlRatio())
            .append("monitorYz", getMonitorYz())
            .append("updateState", getUpdateState())
            .append("userName", getUserName())
            .append("addTime", getAddTime())
            .toString();
    }
}
